#pragma once

namespace WiiCIS {
	namespace IO {
		class Root {
		private:
			bool locked;
			bool connected;

		protected:
			static const short VendorID = 0x057E;
			static const short ProductID = 0x0306;

			void Lock() { locked = true; }
			void Unlock() { locked = false; }
			bool isLocked() { return locked; }

			void setConnected(bool value) { connected = value; }

		public:
			Root() : locked(false), connected(false) { }
			virtual ~Root() { }

			bool isConnected() { return connected; }

			virtual void Connect() = 0;
			virtual void Disconnect() = 0;

			virtual void Read(byte *buffer) = 0;
			virtual void Write(byte *buffer, int length) = 0;

			static Root *Create();
		};
	}
}